package fox.framework.rpc.endpoint.exchange;

import fox.framework.rpc.client.message.request.RpcClientRequest;
import fox.framework.rpc.client.message.response.RpcClientResponse;

/**
 * Exchange Nio线程与调用方法线程进行数据交换的交换器
 * 实现了同步线程和异步线程的交互
 * @author cuichao
 * @Description: RpcExchange
 * @Date: create in 2020/12/17 13:11
 */
public interface RpcExchange {

    /**
     * 阻塞获取
     * @param request
     * @throws InterruptedException
     * @return
     */
    Future register(RpcClientRequest request);
    /**
     * 异步线程设置响应数据
     * @param response
     */
    void exchange(RpcClientResponse response);

}
